import 'package:flutter/material.dart';

class InkWellContainer extends StatelessWidget {
  final double _containerHeight = 60;
  final Widget image;
  final String text;
  final Function onTap;
  final bool bordered;

  InkWellContainer({@required this.image, @required this.text, this.onTap, this.bordered = true});

  BoxDecoration _renderBoxDecoration() {
    bool bordered = this.bordered;
    if (bordered) {
      return BoxDecoration(
        border: Border(
          bottom:
              BorderSide(width: 0.4, color: Color.fromRGBO(200, 200, 200, 1)),
        ),
      );
    } else {
      return null;
    }
  }

  @override
  Widget build(BuildContext context) {
    double _containerHeight = this._containerHeight;

    Widget image = this.image;
    String text = this.text;
    Function onTap = this.onTap;

    return InkWell(
      onTap: onTap,
      child: Container(
        child: Row(
          children: <Widget>[
            Container(
              padding: EdgeInsets.all(8.0),
              child: image,
            ),
            Expanded(
              child: Container(
                height: _containerHeight,
                padding: EdgeInsets.only(left: 8),
                decoration: this._renderBoxDecoration(),
                child: Row(
                  crossAxisAlignment: CrossAxisAlignment.center,
                  children: <Widget>[
                    Text(
                      text,
                      style: TextStyle(fontSize: 16),
                    )
                  ],
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
